<template>
	<view class="content">
		<view @click="back()" class="return">
			<u-icon name="arrow-left" color="#fff" size="44"></u-icon>
		</view>
		<view class="tishi">
			<text>04.1-04.11每日21:00</text>
			<text style="margin-top: 20rpx;">限量100张准点开抢</text>
		</view>
		<view style="display: flex;align-items: center;justify-content: center;margin-top: 130rpx;margin-left: -38rpx;font-size: 234rpx;height: 300rpx;">
			<text class="value">
				{{coupon.coupon_price}}
			</text>
		</view>
		<view style="display: flex;align-items: center;justify-content: center;margin-top: -4rpx;margin-left: -38rpx;font-size: 46rpx;padding-left: 60rpx;">
			<text class="value">
				满{{coupon.use_min_price}}元可用
			</text>
		</view>
		<view style="display: flex;justify-content: center;align-items: center;margin-top: 100rpx;" @click="couponReceive(coupon.id)">
			<u-image width="480rpx" height="100rpx" src="https://img.koalalf.com/coupon/button.png"></u-image>
		</view>
	</view>
</template>

<script>
	import {couponDetail, couponReceive} from "@/common/http.api.js"
	export default {
		data() {
			return {
				coupon:null
			}
		},
		onLoad() {
			let that = this;
			couponDetail({
				coupon_id: 3
			}).then(res => {
				that.coupon = res
			})
		},
		methods: {
			couponReceive(coupon_id){
				let that = this;
				couponReceive({coupon_id
				}).then(res => {
					that.$u.toast('领取成功');
				})
			},
			back() {
				this.$u.route({
					type: 'navigateBack'
				})
			},
		}
	}
</script>

<style lang="scss">
	.content{
		background-image: url('https://img.koalalf.com/coupon/newUser.png');
		width: 100%;
		min-height: 100vh;
		background-size: 100%;
		background-color: #EF3F40;
		background-repeat: no-repeat;
		.return {
			width: 70rpx;
			height: 70rpx;
			border-radius: 50%;
			background-color: rgba($color: #000000, $alpha: 0.4);
			display: flex;
			align-items: center;
			justify-content: center;
			position: fixed;
			left: 40rpx;
			top: 98rpx;
			z-index: 1;
		}
		.tishi{
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			padding-top: 480rpx;
			color: #D63E30;
			font-size: 36rpx;
		}
		.value{
			
			background-image:-webkit-linear-gradient(bottom,#F60F0B,#F86F51 ,#F86F51);
			-webkit-background-clip: text;
			-webkit-text-fill-color: transparent;
			-webkit-animation: hue 90s infinite linear;
		}
	}
</style>
